<template>
  <div class="cart">
    <!-- 头部导航 -->
    <NavBar class="nav-bar">
      <div slot="center">购物车({{length}})</div>
    </NavBar>
    <!-- 列表 -->
    <CartList></CartList>
    <!-- 底部汇总 -->
    <CartBottomBar></CartBottomBar>
  </div>
</template>

<script>

  import NavBar from 'components/common/navbar/NavBar'

  import CartList from './childComps/CartList.vue'
  import CartBottomBar from './childComps/CartBottomBar.vue'

  import { mapGetters } from 'vuex'

  export default {
    name: '',
    data() {
      return {

      }
    },
    computed: {
      // ...mapGetters(['cartLength']),
      ...mapGetters({ length: 'cartLength', list: 'cartList' })
    },
    components: {
      NavBar,
      CartList,
      CartBottomBar
    }
  }
</script>

<style scoped>
  .cart {
    height: 100vh;
  }

  .nav-bar {
    background-color: deeppink;
    color: #fff;
    font-weight: bold;
  }
</style>